//import Kingfisher

import UIKit

class MYHomeSearchCell: YQTableViewBaseCell {

    @objc var searchModel = MYDynamicModel()
    
    @objc @IBOutlet weak var contentLb: UILabel!
    @objc @IBOutlet weak var userHeaderIcon: UIImageView!
    @objc @IBOutlet weak var userNmaeLb: UILabel!
    @objc @IBOutlet weak var timeLb: UILabel!
    @objc @IBOutlet weak var stateCountLb: UILabel!
    @objc @IBOutlet weak var rightImageView: UIImageView!
    override func awakeFromNib() {
        super.awakeFromNib()
        self.userHeaderIcon.layer.cornerRadius = 9;
        self.userHeaderIcon.clipsToBounds = true;
        self.rightImageView.layer.cornerRadius = 8;
        self.rightImageView.clipsToBounds = true;
        self.timeLb.textAlignment = NSTextAlignment.right;
    }

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

    }
    
    @objc func setModel(_ model:MYDynamicModel){
        self.searchModel = model
        self.userNmaeLb.text = model.name
        self.contentLb.text = model.title;
        
        self.rightImageView.setImageWith(URL(string: model.coverImg), placeholder: nil);
        self.userHeaderIcon.setImageWith(URL(string: model.headImg), placeholder: nil);
        self.stateCountLb.text = String(format:"%@%@",kYQLSSwift("点赞数"),model.likeNumber);
        self.timeLb.text = model.createTimeStr;
        
    }
    
}
